package com.miao.elm.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.miao.elm.dao.BusinessDao;
import com.miao.elm.entity.BusinessEntity;
import com.miao.elm.service.BusinessService;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("businessService")
public class BusinessServiceImpl extends ServiceImpl<BusinessDao, BusinessEntity> implements BusinessService {


    @Override
    public List<BusinessEntity> listBusinessByOrderTypeId(int orderTypeId) {
        return this.baseMapper.selectList(new QueryWrapper<BusinessEntity>().eq("order_type_id", orderTypeId));
    }

    @Override
    public BusinessEntity getBusinessById(int businessId) {
        return this.baseMapper.selectOne(new QueryWrapper<BusinessEntity>().eq("business_id", businessId));
    }
}